Fix memory leaks caused by the failure to free the result of
authorMatthias Clasen <maclas@gmx.de>
Sun, 21 Dec 2003 22:28:14 +0000 (22:28 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 21 Dec 2003 22:28:14 +0000 (22:28 +0000)
Sun Dec 21 23:17:01 2003  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkuimanager.c (update_node):
(update_smart_separators):
(_gtk_menu_is_empty):
(find_menu_position):
* gtk/gtktreeview.c (gtk_tree_view_search_dialog_destroy):
* gtk/gtkcombobox.c (gtk_combo_box_relayout_item):
(gtk_combo_box_relayout): Fix memory leaks caused by the
failure to free the result of gtk_container_get_children().
(#127576, Yao Zhang)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c
gtk/gtktreeview.c
gtk/gtkuimanager.c

index ed3fecc030d1537be092563996b992fbcfce858d..18ed04b355ac9dadf3f8058fc328bd55d4a2f537 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Sun Dec 21 23:17:01 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkuimanager.c (update_node): 
+       (update_smart_separators): 
+       (_gtk_menu_is_empty): 
+       (find_menu_position): 
+       * gtk/gtktreeview.c (gtk_tree_view_search_dialog_destroy): 
+       * gtk/gtkcombobox.c (gtk_combo_box_relayout_item): 
+       (gtk_combo_box_relayout): Fix memory leaks caused by the
+       failure to free the result of gtk_container_get_children().
+
 Sun Dec 21 17:34:22 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Set the right
index ed3fecc030d1537be092563996b992fbcfce858d..18ed04b355ac9dadf3f8058fc328bd55d4a2f537 100644 (file)
@@ -1,3 +1,14 @@
+Sun Dec 21 23:17:01 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkuimanager.c (update_node): 
+       (update_smart_separators): 
+       (_gtk_menu_is_empty): 
+       (find_menu_position): 
+       * gtk/gtktreeview.c (gtk_tree_view_search_dialog_destroy): 
+       * gtk/gtkcombobox.c (gtk_combo_box_relayout_item): 
+       (gtk_combo_box_relayout): Fix memory leaks caused by the
+       failure to free the result of gtk_container_get_children().
+
 Sun Dec 21 17:34:22 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Set the right
index ed3fecc030d1537be092563996b992fbcfce858d..18ed04b355ac9dadf3f8058fc328bd55d4a2f537 100644 (file)
@@ -1,3 +1,14 @@
+Sun Dec 21 23:17:01 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkuimanager.c (update_node): 
+       (update_smart_separators): 
+       (_gtk_menu_is_empty): 
+       (find_menu_position): 
+       * gtk/gtktreeview.c (gtk_tree_view_search_dialog_destroy): 
+       * gtk/gtkcombobox.c (gtk_combo_box_relayout_item): 
+       (gtk_combo_box_relayout): Fix memory leaks caused by the
+       failure to free the result of gtk_container_get_children().
+
 Sun Dec 21 17:34:22 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Set the right
index ed3fecc030d1537be092563996b992fbcfce858d..18ed04b355ac9dadf3f8058fc328bd55d4a2f537 100644 (file)
@@ -1,3 +1,14 @@
+Sun Dec 21 23:17:01 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkuimanager.c (update_node): 
+       (update_smart_separators): 
+       (_gtk_menu_is_empty): 
+       (find_menu_position): 
+       * gtk/gtktreeview.c (gtk_tree_view_search_dialog_destroy): 
+       * gtk/gtkcombobox.c (gtk_combo_box_relayout_item): 
+       (gtk_combo_box_relayout): Fix memory leaks caused by the
+       failure to free the result of gtk_container_get_children().
+
 Sun Dec 21 17:34:22 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Set the right
index ed3fecc030d1537be092563996b992fbcfce858d..18ed04b355ac9dadf3f8058fc328bd55d4a2f537 100644 (file)
@@ -1,3 +1,14 @@
+Sun Dec 21 23:17:01 2003  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkuimanager.c (update_node): 
+       (update_smart_separators): 
+       (_gtk_menu_is_empty): 
+       (find_menu_position): 
+       * gtk/gtktreeview.c (gtk_tree_view_search_dialog_destroy): 
+       * gtk/gtkcombobox.c (gtk_combo_box_relayout_item): 
+       (gtk_combo_box_relayout): Fix memory leaks caused by the
+       failure to free the result of gtk_container_get_children().
+
 Sun Dec 21 17:34:22 2003  Soeren Sandmann  <sandmann@daimi.au.dk>
 
        * gdk/x11/gdkwindow-x11.c (gdk_window_reparent): Set the right
index ab2b9ea99624201be7fb80aa7090b27a404df504..9abe2cd97754d642f6b601f19c6aceadb5d8ad5e 100644 (file)
@@ -1484,6 +1484,7 @@ gtk_combo_box_relayout_item (GtkComboBox *combo_box,
 
   list = gtk_container_get_children (GTK_CONTAINER (menu));
   item = g_list_nth_data (list, index);
+  g_list_free (list);
 
   gtk_combo_box_item_get_size (combo_box, index, &cols, &rows);
 
@@ -1537,7 +1538,7 @@ gtk_combo_box_relayout (GtkComboBox *combo_box)
   for (j = g_list_last (list); j; j = j->prev)
     gtk_container_remove (GTK_CONTAINER (menu), j->data);
 
-  g_list_free (j);
+  g_list_free (list);
 
   /* and relayout */
   items = gtk_tree_model_iter_n_children (combo_box->priv->model, NULL);
@@ -2131,6 +2132,7 @@ gtk_combo_box_cell_layout_clear (GtkCellLayout *layout)
 
           gtk_cell_layout_clear (GTK_CELL_LAYOUT (view));
         }
+      g_list_free (list);
     }
 }
 
index c8c2ffb2f25c14ed3f861a08adcef436775f2df6..36bc851a55e7bcd923626884d8275d27fbb6ba68 100644 (file)
@@ -11421,9 +11421,14 @@ static void
 gtk_tree_view_search_dialog_destroy (GtkWidget   *search_dialog,
                                     GtkTreeView *tree_view)
 {
-  GtkEntry *entry = (GtkEntry *)(gtk_container_get_children (GTK_CONTAINER (search_dialog)))->data;
+  GList *list;
+  GtkEntry *entry;
   gint *selected_iter;
 
+  list = gtk_container_get_children (GTK_CONTAINER (search_dialog));
+  entry = (GtkEntry *)list->data;
+  g_list_free (list);
+
   if (tree_view->priv->disable_popdown)
     return;
 
index 14d3e7f1743e7609faed222ad90031afcffdcdbe..420a75a12ae9316b3b07fd6b0425517852447579 100644 (file)
@@ -1537,6 +1537,7 @@ find_menu_position (GNode      *node,
            pos = 1;
          else
            pos = 0;
+         g_list_free (siblings);
          break;
        case NODE_TYPE_MENU_PLACEHOLDER:
          menushell = gtk_widget_get_parent (NODE_INFO (parent)->proxy);
@@ -1677,6 +1678,7 @@ _gtk_menu_is_empty (GtkWidget *menu)
        }
       cur = cur->next;
     }
+  g_list_free (children);
 
   return TRUE;
 }
@@ -1777,6 +1779,8 @@ update_smart_separators (GtkWidget *proxy)
          if (GTK_IS_WIDGET (filler))
            g_object_set (G_OBJECT (filler), "visible", empty, NULL);
        }
+
+      g_list_free (children);
     }
 }
 
@@ -1865,6 +1869,7 @@ update_node (GtkUIManager *self,
                g_object_set (G_OBJECT (siblings->data), 
                              "visible", self->private_data->add_tearoffs && !in_popup, 
                              NULL);
+             g_list_free (siblings);
            }
 
          goto recurse_children;
@@ -1946,10 +1951,11 @@ update_node (GtkUIManager *self,
              g_object_set (G_OBJECT (siblings->data), 
                            "visible", self->private_data->add_tearoffs && !in_popup, 
                            NULL);
+           g_list_free (siblings);
          }
          break;
        case NODE_TYPE_UNDECIDED:
-         g_warning ("found 'undecided node!");
+         g_warning ("found undecided node!");
          break;
        case NODE_TYPE_ROOT:
          break;